
	<div class="panel-heading">第 1 题：</div>
	<div class="panel-body" name="questionsub1">
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2  control-label"><span style='color: red'>*</span>类型</label>
			<div class="col-sm-8">
				<label class="radio-inline"> 
					<input type="radio" name="type" value="1" {if $type ==1} checked="checked" {/if}/>单选
				</label> 
				<label class="radio-inline"> 
					<input type="radio" name="type" value="2" {if $type ==2} checked="checked" {/if}/>多选
				</label>
			</div>
		</div>
		
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2  control-label"><span style='color: red'>*</span>分值</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="points" value="{$points}" />
			</div>
		</div>
		
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2  control-label"><span style='color: red'>*</span>问题</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="question" value="{$question}" />
			</div>
		</div>
		
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color: red'>*</span>答案</label>
			<div class="col-sm-10 col-xs-12">
				<div class="col-sm-10">
					<label class="col-xs-12 col-sm-2 col-md-1">A</label>
					<div class="col-sm-8">
						<input type="text" class="form-control" name="answerA" value="{$reply['answerA']}" />
					</div>
				</div>
				<div class="col-sm-10">
					<label class="col-xs-12 col-sm-2 col-md-1">B</label>
					<div class="col-sm-8">
						<input type="text" class="form-control" name="answerB" value="{$reply['answerB']}" />
					</div>
				</div>
				<div class="col-sm-10">
					<label class="col-xs-12 col-sm-2 col-md-1">C</label>
					<div class="col-sm-8">
						<input type="text" class="form-control" name="answerC" value="{$reply['answerC']}" />
					</div>
				</div>
				<div class="col-sm-10">
					<label class="col-xs-12 col-sm-2 col-md-1">D</label>
					<div class="col-sm-8">
						<input type="text" class="form-control" name="answerD" value="{$reply['answerD']}" />
					</div>
				</div>
			</div>
		</div>
		
		<div class="form-group" id="radioform">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span
				style='color: red'>*</span>正确答案</label>
			<div class="col-sm-9 col-xs-12">
				<label class="radio-inline"> 
					<input type="radio" name="realanswer" value="0" {if $realanswer == 'A'} checked="checked" {/if}/>A
				</label> 
				<label class="radio-inline"> 
					<input type="radio" name="realanswer" value="1" {if $realanswer == 'B'} checked="checked" {/if}/>B
				</label> 
				<label class="radio-inline"> 
					<input type="radio" name="realanswer" value="2" {if $realanswer == 'C'} checked="checked" {/if}/>C
				</label> 
				<label class="radio-inline"> 
					<input type="radio" name="realanswer" value="3" {if $realanswer == 'D'} checked="checked" {/if}/>D
				</label>
			</div>
		</div>
		
		<div class="form-group" id="chkboxform" style="display:none;">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span
				style='color: red'>*</span>正确答案</label>
			<div class="col-sm-9 col-xs-12">
				<label class="radio-inline"> 
					<input type="checkbox" name="realanswer" value="0" {if $realanswer == 'A'} checked="checked" {/if}/>A
				</label> 
				<label class="radio-inline"> 
					<input type="checkbox" name="realanswer" value="1" {if $realanswer == 'B'} checked="checked" {/if}/>B
				</label> 
				<label class="radio-inline"> 
					<input type="checkbox" name="realanswer" value="2" {if $realanswer == 'C'} checked="checked" {/if}/>C
				</label> 
				<label class="radio-inline"> 
					<input type="checkbox" name="realanswer" value="3" {if $realanswer == 'D'} checked="checked" {/if}/>D
				</label>
			</div>
		</div>
	</div>

<div name="questionlist">
</div>
<div class="col-sm-12">
	<input name="addquestion" type="button" value="添加题目" class="btn btn-primary col-lg-1">
</div>
<script type="text/javascript">
var num=2;
$("input[name='type']").click(function(){
	if($(this).val()==1){
		$("#radioform").show();
		$("#chkboxform").hide();
	}else if($(this).val()==2){
		$("#radioform").hide();
		$("#chkboxform").show();
	}
})	

$("input[name='addquestion']").click(function(){
	//$(".panel panel-default").clone().appendTo("#questionlist");
	var head='<div class="panel-heading">第 '+num+' 题：</div>';
	$("div[name='questionlist']").append(head);
	//$("div[name='questionlist']").append().clone());
	
	var obj = $("div[name='questionsub1']").clone(true);
	obj.attr("name","questionsub"+num);//改变clone对象的id和内容以区分
	$("div[name='questionlist']").append(obj);
	num++;
})

</script>